package com.itheima.dao;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 32338
 * @date 2024-05-04 15:17:38
 * @description 预约设置管理的数据层
 */
@Mapper
public interface OrderSettingDao {

    /**
     * @description
     ***:删除当天的信息
     **/
    @Delete("delete from t_ordersetting where orderDate = #{orderDate}")
    void deleteByDate(OrderSetting orderSetting);

    /**
     * @description
     ***:根据日期修改可预约人数
     **/
    @Insert("insert into t_ordersetting(orderDate, number, reservations) VALUES (#{orderDate},#{number},#{reservations})")
    void insert(OrderSetting orderSetting);



    /**
     * @description
     ***:根据年月查询对应的预约设置信息
     **/
    @Select("select *from t_ordersetting where month(orderDate) = #{monthNumber}")//根据月份来查询数据
    List<OrderSetting> getByMonth(String monthNumber);


    /**
     * @description
     ***:模板下载
     **/

    /**
     * @description
     ***:文件上传
     **/
}
